# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=oq
pkgver=1.3.4
pkgrel=2
pkgdesc="portable jq wrapper with support of other formats than JSON"
url="https://github.com/blacksmoke16/oq"
arch="x86_64 aarch64"  # limited by Crystal
license="MIT"
depends="jq"
makedepends="crystal libxml2-dev yaml-dev"
source="https://github.com/Blacksmoke16/oq/archive/v$pkgver/oq-$pkgver.tar.gz
	jq-1.7.patch
	"

build() {
	mkdir -p bin
	crystal build --release -o bin/oq src/oq_cli.cr
}

check() {
	crystal spec
}

package() {
	install -D -m 755 bin/oq "$pkgdir"/usr/bin/oq
}

sha512sums="
41c6418bf02457da7d09b5348e6416dfe534bd6a2c1c2e398e51d523f5c116f7c33bb96c25fef36e6b9dc608bb70bd0bde78177b9f91829e9e65ebab3510ca60  oq-1.3.4.tar.gz
25cc2f7728487da00933fda04d211fb2411376c13524e3642ec85c5fd5980e0574680e4c54bd96bc61e3e06772344a5fc81bb0d68543d397dfdfe6e9ad159c4b  jq-1.7.patch
"
